﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SaveMySchedule.aspx.cs" Inherits="MyOA.UI.ScheduleManage.PersonSchedule.SaveMySchedule" MasterPageFile="~/RightFrame.Master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Register src="../../UserControl/UserCalender.ascx" tagname="UserCalender" tagprefix="uc1" %>

<asp:Content ContentPlaceHolderID="cphTitle" ID="cph1" runat="server">
 你的位置：<a href="PersonSchedule.aspx?NodeValuePath=102001">个人日程</a>>个人日程设置
    <script type="text/javascript">
       var Alert=ymPrompt.alert;
        var Error=ymPrompt.errorInfo;
        
        function aHref()
        {
            document.location.href="PersonSchedule.aspx?NodeValuePath=102001";
        }
    </script>
    
    
<style type="text/css">
        
        
 

.textbox
{
	border-width:0px;
	background-image:url(../../images/Calendar.png);
	background-position:right;
	background-repeat:no-repeat;
	width:200px;
	
}


.calender
{
	color: #003399; 
    font-family: "宋体"; 
    font-style: normal; 
    border: 1px #93BEE2 solid; 
    margin:0px;
    padding:0px;
    
    width:130px;
    height:15px;
}

.img
{
	height:18px;
	vertical-align:middle;
}

span
{
	text-align:left;
}
    </style>
    
 <script type="text/javascript">
    
    var title,address,start,end,content;
    function saveClick()
    {
      title=document.getElementById("<%=txtTitle.ClientID %>");
     address=document.getElementById("<%=txtAddress.ClientID %>");
     start=document.getElementById("<%=txtStart.ClientID%>");
     end=document.getElementById("<%=txtEnd.ClientID %>");
     content=document.getElementById("<%=txtContent.ClientID %>");
    
    
        if(title.value=="")
        {
            Error("标题不能为空",null,null,'温馨提示',titleFocus);
            return false;
        }
        if(address.value=="")
         {
            Error("地址不能为空",null,null,'温馨提示',addressFocus);
            return false;
        }
        if(start.value=="")
         {
            Error("开始时间不能为空",null,null,'温馨提示',startFocus);
            return false;
        }
        

        if(end.value=="")
         {
            Error("结束时间不能为空",null,null,'温馨提示',endFocus);
            return false;
        }

//           var d=toDate(start.value);
//           alert(d);
//           if(startDate>endDate)
//           {
//               Error("开始时间不能晚与结束时间",null,null,'温馨提示',startFocus);
//               return false;
//             
//           }
        if(content.value=="")
        {
            Error("内容不能为空",null,null,'温馨提示',contentFocus);
            return false;
        }
        
        return true;
    }
    
    function titleFocus()
    {
        title.focus();
    }
    function addressFocus()
    {
        address.focus();
    }
    function startFocus()
    {
        start.value="";
        start.focus();
    }
    function endFocus()
    {
        end.value="";
        end.focus();
    }
    function contentFocus()
    {
        content.focus();
    }
    
    function toDate(temp)
    {
         //取出日期和时间集合
            var time=temp.split(" ");
            //取出日期集合
            var date=time[0].split(",")
            
            var year=date[0];
            var month=date[1];
            var day=date[2];
           // alert(year+""+month+""+day);
           
           //取出时间集合
           var datetime=time[1].split(":");
           var hour=datetime[0];
           var min=datetime[1];
           var sec=datetime[2];
           //alert(hour+""+min+""+sec);
           
           var startDateTime=new Date();
           startDateTime.setFullYear(year,month,day);
//           startDateTime.setHours(hour);
//           startDateTime.setMinutes(min);
//           startDateTime.setSeconds(sec);
           return startDateTime;
         
//           var startDate=new Date("2009","9","1");
//           var endDate=new Date(end.value);
//           alert(startDate+" "+endDate);
    }
   </script>
</asp:Content>

<asp:Content ContentPlaceHolderID="cphContnent" ID="cph2" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
  
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
    <div class="body_title">个&nbsp;&nbsp;人&nbsp;&nbsp;日&nbsp;&nbsp;程&nbsp;&nbsp;设&nbsp;&nbsp;置</div>
    <div class="body_content">
        <div class="div_title"><span class="span_title">主题：</span><asp:TextBox ID="txtTitle" runat="server" CssClass="inputText" Width="600"></asp:TextBox></div>
        <div class="div_addressAndMeetingClass">
            <span class="span_address">
                <span>地点：</span>
                <asp:TextBox ID="txtAddress" runat="server" CssClass="inputText" Width="200"></asp:TextBox>
            </span>
            
            <span class="span_meetingClass">
                <span>会议类型：</span><asp:DropDownList ID="ddlMeetingClass" runat="server" 
                CssClass="inputText" Width="190px" DataSourceID="getAllMeetings" 
                DataTextField="MeetingName" DataValueField="MeetingId"></asp:DropDownList>
            <asp:ObjectDataSource ID="getAllMeetings" runat="server" 
                SelectMethod="getAllMeetings" TypeName="MyOA.BLL.SaveMyScheduleManage">
            </asp:ObjectDataSource>
            </span>
        </div>
        
        <div class="div_userCalender">
            
           
    开始时间：
    <span id="startTime">
        
        
        <asp:TextBox ID="txtStart" runat="server" CssClass="textbox calender"  Enabled="true" onfocus="new WdatePicker(this,'%Y-%M-%D',true,'whyGreen')"></asp:TextBox>
   
</span>

<span>
&nbsp;&nbsp;
-------
&nbsp;&nbsp;
</span>



    结束时间：
    <span id="endTime">
         <asp:TextBox ID="txtEnd" runat="server" CssClass="textbox calender"  Enabled="true" onfocus="this.value='';new WdatePicker(this,'%Y-%M-%D %h:%m:%s',true,'whyGreen')"></asp:TextBox>
      
</span>
        </div>
        
        <div class="div_content">
            <asp:TextBox ID="txtContent" runat="server" Height="100px" Width="642px" 
                CssClass="inputText" TextMode="MultiLine"></asp:TextBox>
        </div>
        
        <div class="div_preContract">
            <span>预约他人：</span><asp:Image ID="imgPreContract" runat="server"  ImageUrl="../../images/admin2.gif" onmouseover="this.style.cursor='hand'"/>
        </div>
        
        <div class="div_preContract2">
            <asp:ListBox ID="lbPreContract" runat="server" CssClass="lbPreContract" SelectionMode="Multiple"></asp:ListBox> 
            <span >
                <asp:Button ID="btnDeletePerson" runat="server" Text="删除人"  CssClass="btn" 
                onMouseOver="document.getElementById(this.id).className='btnOver'" 
                onMouseOut="document.getElementById(this.id).className='btnOut'" 
                onclick="btnDeletePerson_Click"/>
            </span> 
        </div>
        
        <div class="div_createInfo">
           
            <span>创建者：<asp:Label ID="lblCreateUser" runat="server" Text=""></asp:Label></span>
            <span>创建日期：<asp:Label ID="lblCreateDate" runat="server" Text=""></asp:Label></span>
        </div>
        
        <div class="div_button">
            <span>
                <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="btn" 
                onMouseOver="document.getElementById(this.id).className='btnOver'" 
                onMouseOut="document.getElementById(this.id).className='btnOut'" 
                onclick="btnSave_Click" OnClientClick="return saveClick();"/>
            </span>
            
            <span>
                <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="btn" 
                onMouseOver="document.getElementById(this.id).className='btnOver'" 
                onMouseOut="document.getElementById(this.id).className='btnOut'" 
                onclick="btnDelete_Click" OnClientClick="return confirm('确实要删除日程吗？')"/>
            </span>
            
            <span>
                <asp:Button ID="btnExit" runat="server" Text="退出" 
                PostBackUrl="~/ScheduleManage/PersonSchedule/PersonSchedule.aspx?NodeValuePath=102001" 
                CssClass="btn" 
                onMouseOver="document.getElementById(this.id).className='btnOver'" 
                onMouseOut="document.getElementById(this.id).className='btnOut'" 
               />
            </span>
                
        </div>
    </div>
    
    <div ID="panHidden" runat="server" class="hidden" style="display:none;">
        <asp:TreeView ID="tvUserInfo" runat="server" OnSelectedNodeChanged="tvUserInfo_SelectedNodeChanged" >
            
        </asp:TreeView>
    </div>
        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
        TargetControlID="imgPreContract" PopupControlID="panHidden"
        DropShadow="True" Drag="True" PopupDragHandleControlID="panHidden"
         X="300" Y="5">
    </cc1:ModalPopupExtender> 
    </ContentTemplate>
    </asp:UpdatePanel>
    
    
</asp:Content>